import CryptoJS from 'crypto-js';
const KEY = CryptoJS.enc.Utf8.parse('d7b85f6e214abcde');
//加密
export const AES_Encrypt = (plaintext:string) => {
    let ciphertext = CryptoJS.AES.encrypt(plaintext, KEY, {
        mode: CryptoJS.mode.ECB,
        padding: CryptoJS.pad.Pkcs7
    }).toString();
    return ciphertext;
};
//解密
export const AES_Decrypt = (ciphertext:string) => {
let plaintext = CryptoJS.AES.decrypt(ciphertext, KEY, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
}).toString(CryptoJS.enc.Utf8);
return plaintext;
};